<template>
    <div class="siteTop">

        <div class="navBar">

				<siteLeft></siteLeft>

                <div class="content-right">

            <siteRight>

                 <div class="nav-right">
                     <div class="item">
                    <a href="http://www.guoqi666.work" target="_blank">
                    <img src="../../../assets/img/siteTop/home.png" width="40">
                    <p>网站首页</p>
                    </a>
                 </div>

                 <div class="item">
                    <a href="javascript:;">
                    <img src="../../../assets/img/siteTop/news.png" width="40">
                    <p>消息提示</p>
                    </a>
                    <ul class="ulShow">
                    <li><p><a href="javascript:;">消息一</a></p><p>1</p></li>
                    </ul>
                 </div>

                 <div class="item">
                     <a href="javascript:;">
                     <img src="../../../assets/img/siteTop/put.png" width="40">
                    <p>清理缓存</p>
                    </a>
                    
                 </div>

                 <div class="item">
                    <a href="javascript:;">
                     <img src="../../../assets/img/siteTop/user.png" width="40">
                    <p>{{adminName}}</p>
                    </a>
                    <ul class="ulShow">
                    <li><p><a href="javascript:;" @click="logOut">退出登录</a></p></li>
                    </ul>
                 </div>

                </div>
            </siteRight>

                </div>
				
				
		
			</div>

    </div>
</template>

<script>
import siteRight from './siteRight'
import siteLeft from './siteLeft'

export default {
    name:'siteTop',
       data(){
       return{
            adminName:this.$store.state.adminName
        }
    },
    components:{
        siteRight,
        siteLeft
    },
    methods:{
        logOut(){
             //修改vuex中的数据
            this.$store.commit({
                type:'upDateaAminToken',
                token:''
            })

            this.$store.commit({
                 type:'upDateaAdminName',
                 name:''
            })

            document.cookie="adminToken=; path=/"
            document.cookie="adminName=; path=/"
        }
    }
}
</script>

<style scoped>
.siteTop{
    background-color: #fff;
    height: 80px;
    box-shadow: 2px 2px 3px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    z-index: 1;
}
.navBar{
    width: 100%;
    height: 80px;
    display: flex;
}
.navBar .title{
    width: 25%;
    padding-left: 15px;
}
.title p{
    font-size: 25px;
    font-weight: bold;
    height: 100%;
    line-height: 80px;
}
.title p img{
   float: left;
   margin-top: 20px;
}

.navBar .content-right{
    width: 80%;
}
</style>